Posts

Showing posts with the label K-Pop Celeb Like Me dev

Fixing a TensorFlow Lite model loading error in a preview build

Image
 In my previous post, I described how I moved K-Pop Celeb Like Me from a WebView implementation to a local React Native app. I also explained why I switched from TensorFlow.js to TensorFlow Lite after finding that image prediction was too slow on Android. After getting the basic image recognition feature working, I moved on to testing preview builds on real devices. That was when I encountered another problem: the model worked during development, but the app could not load it in the Android preview build. In this post, I will explain the error, the cause I identified, and the change that allowed the model to load successfully in both Android and iOS preview builds. The model worked during development but failed in the APK My app uses image classification models exported from Teachable Machine. I bundled the TensorFlow Lite model files and their corresponding label files inside the project. The model-loading function initially looked like this: export async function loadModel(g...

WebView to local app: testing on-device image recognition

Image
 When I started developing K-Pop Celeb Like Me , the app was originally built as a WebView app. The main feature was simple: users could select or take a photo, and an image classification model trained with Teachable Machine would predict which K-pop celebrity looked most similar to them. The web version already worked, so I initially considered keeping it as a WebView app. However, before developing more features, I wanted to check whether I could run the same model directly inside a React Native app. There were two main reasons for this experiment. First, I wanted to reduce the app's dependence on a separately hosted website. Second, I wanted to see whether running image recognition locally would provide a better experience, especially on Android devices. This post describes my initial traffic investigation, my first attempt using TensorFlow.js, and the performance improvement I observed after switching to TensorFlow Lite. Why I considered moving away from WebView My website was...